home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-07-15 | 2.4 KB | 96 lines | [TEXT/MPS ] |
- // Copyright © 1991 Apple Computer, Inc. All rights reserved.
-
- #include "UDialogs.h"
-
- extern "C" char* memcpy(void*, void*, int);
- #define pstrcpy(p,q) memcpy(p, q, q[0]+1) // added for translation: Pascal strcpy
-
- const long kFileType = '????';
- const short kModelessID = 2000;
-
-
- //----------------------------------------------------------------------------
-
- #pragma segment AInit
- pascal void TDialogsApplication::IDialogsApplication()
- {
- this->IApplication(kFileType);
-
- if (gDeadStripSuppression) {
- TModelessView *aModelessView = new TModelessView;
- }
-
- TWindow *aWindow = NewTemplateWindow(kModelessID, NULL);
- aWindow->Open();
-
- }
-
-
- //------------------------------------------------------------------------------
-
- #pragma segment AInit
- pascal void TDialogsApplication::HandleFinderRequest()
- {
- // don't open application by clicking on file
- }
-
-
- //------------------------------------------------------------------------------
-
- #pragma segment ASelCommand
- pascal TCommand * TDialogsApplication::DoMenuCommand(CmdNumber aCmdNumber)
- {
- switch (aCmdNumber){
- default: // always do this, so other objects get a chance
- return inherited::DoMenuCommand(aCmdNumber);
- }
- }
-
-
- //------------------------------------------------------------------------------
-
- #pragma segment ARes
- pascal void TModelessView::DoChoice (TView *origView, short itsChoice)
- {
- Str255 menuText;
- Str255 selected;
-
- TEditText *anEditText1 = (TEditText *) this->FindSubView('edit');
- TEditText *anEditText2 = (TEditText *) this->FindSubView('edi2');
-
- switch (itsChoice){
- case mRadioHit: // do something with the radio button selection
-
- if ( origView == (TRadio *) this->FindSubView('sel1') ){
-
- #if qDebug
- printf("User selected button 1\n");
- #endif
-
- anEditText2->DimState(TRUE,kDontRedraw); // disable
- anEditText2->ViewEnable(FALSE,kRedraw);
- anEditText2->StopEdit();
-
- anEditText1->DimState(FALSE,kDontRedraw); // enable
- anEditText1->ViewEnable(TRUE,kRedraw);
- anEditText1->StartEdit(TRUE,fTEView);
- }
-
- else if ( origView == (TRadio *) this->FindSubView('sel2') ){
-
- #if qDebug
- printf("User selected button 2\n");
- #endif
-
- anEditText1->DimState(TRUE,kDontRedraw); // disable
- anEditText1->ViewEnable(FALSE,kRedraw);
- anEditText1->StopEdit();
-
- anEditText2->DimState(FALSE,kDontRedraw); // enable
- anEditText2->ViewEnable(TRUE,kRedraw);
- anEditText2->StartEdit(TRUE,fTEView);
- }
- break; // case mRadioHit
- }
- inherited::DoChoice(origView,itsChoice);
- }